#######################################################
# Sample Application Configuration File               #
#######################################################

# Postgres95 specific variables; choice of:
# PGHOST, PGOPTIONS, PGPORT, PGTTY, PGDATABASE, PGREALM.
# See the Postgres manual for details, but you will need to set 
# PGDIR the Postgres95 home directory,
# PGHOST the machine on which Postgres is running and PGDATABASE the
# database containing your database files.

PGDIR=/usr/local/postgres95
PGHOST=arthur
PGDATABASE=root

# HTTPD specific stuff; HTTPD-DIR is the httpd home directory,
# CGI-URL is the URL of the cgi-bin directory where
# the generated application scripts will be placed. DOC-URL is a document
# directory where plain HTML files can be placed.

HTTPD-DIR=/usr/local/httpd
CGI-URL=http://arthur/apps
DOC-URL=http://arthur/docs

# Data structure details, TABLE-NAME defines the name of the database class,
# SCREEN-TITLE defines the title on screen, SUMMARY-LIST defines which fields
# are listed on the search summary and FIELDS: is an SQL type definition of 
# the datafile attributes. * denotes primary key and may include several
# attributes. $=attribute FROM class - denotes a foreign key with relationship.
# Terminate each table definition with an END-TABLE clause.


TABLE-NAME=subjective
SCREEN-TITLE=Subjective Costcodes
SUMMARY-LIST=costcode, description
FIELDS:
	costcode char(7) *
	description char(45)
	sub_type int
END-TABLE

TABLE-NAME=supplier
SCREEN-TITLE=Supplier Details
SUMMARY-LIST=ref, name
FIELDS:
	ref char(8) *
	name char(45)
	addr1 char(45)
	addr2 char(30)
	addr3 char(30)
	addr4 char(30)
	tel char(15)
	fax char(15)
	supplier_type int
END-TABLE 

TABLE-NAME=programme
SCREEN-TITLE=Programme Codes
SUMMARY-LIST=code, description
FIELDS:
	code char(3) *
	description char(45)
	prog_type int
END-TABLE 

TABLE-NAME=scheme
SCREEN-TITLE=Scheme Details
SUMMARY-LIST=scheme_id, title
FIELDS:
	scheme_id char(6) *
	title char(45)
	programme_code char(3) $=code from programme
	costcode char(7)
	status int
	manager char(6) $=ref from user
END-TABLE 

TABLE-NAME=invoice
SCREEN-TITLE=Invoice Entry
SUMMARY-LIST=supplier, invoice_number, obj_code, sub_code, total
FIELDS:
	obj_code char(7) * $=costcode from scheme
	sub_code char(7) * $=costcode from subjective
	supplier char(8) * $=ref from supplier
	invoice_number * char(20)
	total float
	invoice_date date
	processed date
	retention float
	vat float
END-TABLE 

TABLE-NAME=cashflow
SCREEN-TITLE=Cashflow
SUMMARY-LIST=scheme_id, sub_code, month, year, amount
FIELDS:
	scheme_id char(6) * $=scheme_id from scheme
	month int *
	year int *
	amount float
END-TABLE 

TABLE-NAME=approval
SCREEN-TITLE=Approval Entry
SUMMARY-LIST=scheme_id, amend_number
FIELDS:
	scheme_id char(6) * $=scheme_id from scheme
	amend_number int *
	sub_code char(7) * $=code from subjective
	limit float
END-TABLE 

TABLE-NAME=user
SCREEN-TITLE=User Maintenance
SUMMARY-LIST=ref, name
FIELDS:
	ref char(6) *
	name char(45)
	password char(8)
	user_type int
END-TABLE
